local japi = require 'jass.japi'
local jass = require 'jass.common'
local console = require '系统.基础界面.控制台'


local info = {
    ['经验条']   = ac.frame.convert(japi.SimpleFrameFindByName("SimpleHeroLevelBar", 0),nil, nil, true),
    ['经验进度'] = ac.frame.convert(japi.SimpleFrameFindByName("SimpleProgressIndicator", 0),nil, nil, true),
    ['经验文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("SimpleClassValue", 0),nil, nil, true),
    ['英雄称谓'] = ac.frame.convert(japi.SimpleFontStringFindByName("SimpleNameValue", 0),nil, nil, true),
    ['建筑名字'] = ac.frame.convert(japi.SimpleFontStringFindByName("SimpleBuildingNameValue", 1),nil, nil, true),
    ['科多名字'] = ac.frame.convert(japi.SimpleFontStringFindByName("SimpleHoldNameValue", 2),nil, nil, true),
    ['力量文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroStrengthLabel", 6),nil, nil, true),
    ['力量数值'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroStrengthValue", 6),nil, nil, true),
    ['敏捷文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroAgilityLabel", 6),nil, nil, true),
    ['敏捷数值'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroAgilityValue", 6),nil, nil, true),
    ['智力文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroIntellectLabel", 6),nil, nil, true),
    ['智力数值'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconHeroIntellectValue", 6),nil, nil, true),
    ['属性图标'] = ac.frame.convert(japi.SimpleFrameFindByName("SimpleInfoPanelIconHero", 6),nil, nil, true),
    ['攻击图标'] = ac.frame.convert(japi.SimpleTextureFindByName("InfoPanelIconBackdrop", 0),nil, nil, true),
    ['攻击数值'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconLabel", 0),nil, nil, true),
    ['攻击文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconValue", 0),nil, nil, true),
    ['护甲图标'] = ac.frame.convert(japi.SimpleTextureFindByName("InfoPanelIconBackdrop", 2),nil, nil, true),
    ['护甲文本'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconLabel", 2),nil, nil, true),
    ['护甲数值'] = ac.frame.convert(japi.SimpleFontStringFindByName("InfoPanelIconValue", 2),nil, nil, true),
    
    -- ['英雄图标0']   = ac.frame.convert(japi.FrameGetHeroBarButton(0), nil, nil, true),
    -- ['英雄图标1']   = ac.frame.convert(japi.FrameGetHeroBarButton(1), nil, nil, true),
    -- ['英雄图标2']   = ac.frame.convert(japi.FrameGetHeroBarButton(2), nil, nil, true),
    -- ['英雄图标3']   = ac.frame.convert(japi.FrameGetHeroBarButton(3), nil, nil, true),
    -- ['英雄图标4']   = ac.frame.convert(japi.FrameGetHeroBarButton(4), nil, nil, true),
    -- ['英雄图标5']   = ac.frame.convert(japi.FrameGetHeroBarButton(5), nil, nil, true),
    -- ['英雄图标6']   = ac.frame.convert(japi.FrameGetHeroBarButton(6), nil, nil, true),

}


--全部隐藏 
for k,v in pairs(info) do 
    japi.FrameClearAllPoints(v.handle)
    v:set_position(1920, 1080)
end

-- buff 栏干掉
ac.wait(0, function ()
    for i = 0, 7, 1 do 
        local handle = japi.FrameGetBuffButton(i)
        if handle ~= 0 then 
            japi.FrameSetPoint(handle, 8, japi.GetGameUI(), 8, 0.3, 0.16)
        end 
    end 
    for i = 1, 6, 1 do 
        local handle = japi.FrameGetHeroBarButton(i)
        if handle ~= 0 then 
            japi.FrameClearAllPoints( handle )
            japi.FrameSetPoint(handle, 8, japi.GetGameUI(), 8, -0.8, 0.0)
        end 
    end 
    --japi.FrameShow( japi.FrameFindByName("PauseButton", 0)    , false)
    --japi.FrameShow( japi.FrameFindByName("SaveGameButton", 0) , false)
    --japi.FrameShow( japi.FrameFindByName("LoadGameButton", 0) , false)
    --jass.PauseGame(false)
end)
